\documentclass[xcolor=svgnames]{beamer}

%\documentclass[compress]{beamer}
\mode<presentation>
%\definecolor{myred}{rgb}{0.5,0,0}
%\usetheme{boadilla}
%\usecolortheme[named=myred]{structure}
\usepackage{beamerthemeCopenhagen}

\usecolortheme{default}

\usepackage{graphicx}
% \usepackage{amssymbol}
\usepackage[latin1]{inputenc}
\usepackage{amssymb}
\usepackage{color}
\usepackage{parskip}

\usepackage{gnuplot-lua-tikz}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage{adjustbox}
\usepackage{pbox}

\begin{document}

\begin{frame}[c]{The BHP distribution}

\begin{figure}[htp]
\centering
\includegraphics[scale=.65]{bhp.png}
\caption{BHP density function. We have used a BHP distribution table calculated by Gon\c{c}alves. \cite{Goncalves:09}}
\label{}
\end{figure}

\end{frame}


\begin{frame}[c]{Markov chain for memory 1}

\begin{figure}[htp]
\centering
\input{diagram-m1-present.tex}
\caption{Markov chain with memory .}
\end{figure}

\end{frame}


\begin{frame}[c]{Data split exemplification}

\begin{figure}[htp]
\centering
\begin{tikzpicture}
\draw (0,0) rectangle (1,.6); \draw (.5,.3) node {1.72};
\draw (1,0) rectangle (2,.6); \draw (1+.5,.3) node {1.69};
\draw (2,0) rectangle (3,.6); \draw (2+.5,.3) node {1.73};
\draw (3,0) rectangle (4,.6); \draw (3+.5,.3) node {1.66};
\draw (4+.5,.3) node {...};
\draw[|-|] (0,-.3) -- (3,-.3); \draw (3/2,-.3) node[below] {$m$};
\draw[|-|] (1,-.7) -- (4,-.7); \draw (1+3/2,-.7) node[below] {$m$};
\end{tikzpicture}
\caption{Showing the split of data ($m=3$).}
\end{figure}

\end{frame}


\begin{frame}[c]{The algorithm}
We first define a flow window by $FW$ which is a binary vector of size $m\in\mathbb{N}$ and an $\alpha \in [0,1]$.

Then the data to be used is defined by

$T=\{t:\vec{R}(t)=FW\}$

We also define $\mu_\alpha$, $\sigma_\alpha$ as the mean and standard deviation of $rd(t)^\alpha$ for $t\in T$ and the $\alpha$ fluctuations by

$r_\alpha (t)=\frac{rd(t)^\alpha - \mu_\alpha}{\sigma_\alpha}$

The $\alpha$'s used in this work are the $\alpha$'s that best fit $r_\alpha(t)$ to the BHP distribution for each $FW$. We find these $\alpha$'s using the Kolmogorov-Smirnov statistical test.

\end{frame}


\begin{frame}[c]{Alpha study}

\begin{figure}[htp]
\centering
\includegraphics[scale=0.60]{alphaday.png}
\caption{$\alpha(day)$}
\label{}
\end{figure}

\end{frame}


\begin{frame}[c]{Alpha study}

\begin{figure}[htp]
\centering
\includegraphics[scale=0.45]{alphamonth.png}
\caption{$\alpha(month)$}
\label{}
\end{figure}

\end{frame}


\begin{frame}[c]{Climate change test}

\begin{figure}[htp]
\centering
\includegraphics[scale=0.36]{climatetest.png}
\caption{Kolmogorov-Smirnov test, comparing 2 pairs of samples through the years (in a 4, 10 and 20 year diameter, around each  year). In black, $pvalues < 0.01$. In gray, $pvalues < 0.05$. (gerar em format latex. virar ao contrario.)}
\label{}
\end{figure}

\end{frame}


\begin{frame}[c]{Climate change test}

\begin{figure}[htp]
\centering
\includegraphics[scale=0.30]{markovbinomtest.png}
\caption{Binomial test, comparing 2 markov chains through the years (in a 4, 10 and 20 year diameter, around each  year). In black, the distributions have the same probability of occuring with a significance lvl of $95\%$. In white, the distributions probabilities don't match.}
\label{}
\end{figure}

\end{frame}

\begin{frame}[c]{Climate change test}

\include{table-final1-paiva}

\end{frame}

\end{document}